﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using Argos.Activities;

namespace Argos.Data.Model
{
	/// <summary>
	/// Represents a recipient that receives alerts sent by Argos.
	/// </summary>
	[Serializable]
	public class Recipient : ItemBase
	{

		#region public string Address { get; set; }

		private static string AddressPropertyName = "Address";

		/// <summary>
		/// Sets or returns the address of the recipient.
		/// </summary>
		public string Address
		{
			get { return this.GetProperty<string>(AddressPropertyName); }
			set { this.SetProperty(AddressPropertyName, value); }
		}

		#endregion

		#region public MessageDeliveryRoute DeliveryRoute { get; set; }

		private static string DeliveryRoutePropertyName = "DeliveryRoute";

		/// <summary>
		/// Returns the message delivery route used by the client.
		/// </summary>
		public MessageDeliveryRoute DeliveryRoute
		{
			get
			{
				MessageDeliveryRoute route = this.GetProperty<MessageDeliveryRoute>(DeliveryRoutePropertyName);
				if (null == route)
				{
					route = new MessageDeliveryRoute();
					this.SetProperty(DeliveryRoutePropertyName, route);
				}
				return route;
			}
		}

		#endregion
		
		#region public string Name { get; set; }

		private static string NamePropertyName = "Name";

		/// <summary>
		/// Sets or returns the name of the recipient.
		/// </summary>
		public string Name
		{
			get { return this.GetProperty<string>(NamePropertyName); }
			set { this.SetProperty(NamePropertyName, value); }
		}

		#endregion


	}
}
